<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>奔跑的熊大案例</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        body {
            background: #ccc;
        }

        .xiong {
            position: absolute;
            width: 200px;
            height: 100px;
            background: url(media/bear.png) no-repeat;
            animation: move 1s steps(8) infinite, bear 3s forwards;
            /* position: relative; */
        }

        /* .shan {
            background: url(media/bg1.png) no-repeat;
            width: 3840px;
            height: 336px;
            position: absolute;
            animation: shan 12s ease infinite;
        }  */


        @keyframes move {
            0% {
                background-position: 0 0;
            }

            100% {
                background-position: -1600px 0;
            }
        }

        @keyframes bear {
            0% {
                left: 0;
            }

            100% {
                left: 50%;
                transform: translate(-50%);
            }
        }

        @keyframes shan {
            0% {
                background-position: 0 0;
            }

            100% {
                background-position: -1620px 0;
            }
        }
    </style>
</head>

<body>
    <div class="xiong"></div>
    <div class="shan"></div>
</body>

</html>